/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_bestlyg_security_keys';

  // add your middleware config here
  config.middleware = [];
  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    cluster: {
      listen: {
        port: 50000,
        hostname: '127.0.0.1',
      },
    },
    email: {
      host: 'smtp.qq.com',
      user: '1057966749@qq.com',
      pass: 'deyxyhnkyvlwbfde',
    },
    assets: {
      publicPath: '/view/',
    },
    security: {
      csrf: {
        enable: false,
      },
    },
    cors: {
      allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
      credentials: true,
      origin: '*', // 允许的请求来源（* 表示允许所有的IP的请求 ）
    },
    mongoose: {
      url: 'mongodb://www.bestlyg.com:27017/bestlyg',
      options: {},
      // mongoose global plugins, expected a function or an array of function and options
      // plugins: [createdPlugin, [updatedPlugin, pluginOptions]],
    },
  };
  return {
    ...config,
    ...userConfig,
  };
};
